#ifndef __FSM_MSG_H__
#define __FSM_MSG_H__

#include "stdint.h"
#include "string.h"

typedef struct fsm_msg_str {
    uint32_t msg_rx_cnt;    // 消息数量
    uint32_t msg_cnt;       // 消息总数
    uint32_t msg_size;      // 消息大小
    uint8_t *msg_pool;      // 消息池
    uint8_t *msg_read_idx;  // 消息读取位置
    uint8_t *msg_write_idx; // 消息写入位置
} fsm_msg_t;

void fsm_msg_init(fsm_msg_t *msg_ctr, uint8_t *msg_pool, uint32_t msg_cnt, uint32_t msg_size);
int  fsm_msg_write(fsm_msg_t *msg_ctr, uint8_t *pData, uint32_t DatLen);
int  fsm_msg_read(fsm_msg_t *msg_ctr, uint8_t *pData);

#endif
